load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")
load("@fbsource//tools/build_defs:rust_unittest.bzl", "rust_unittest")

oncall("scm_server_infra")

rust_library(
    name = "live_commit_sync_config",
    srcs = glob(["src/**/*.rs"]),
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:async-trait",
        "fbsource//third-party/rust:thiserror",
        "//common/rust/shed/cached_config:cached_config",
        "//configerator/structs/scm/mononoke/repos:commitsync-rust",
        "//eden/mononoke/megarepo_api:pushredirect",
        "//eden/mononoke/metaconfig:metaconfig_parser",
        "//eden/mononoke/metaconfig:metaconfig_types",
        "//eden/mononoke/mononoke_types:mononoke_types",
        "//eden/mononoke/server/context:context",
    ],
)

rust_unittest(
    name = "live_commit_sync_config_test",
    srcs = glob(["test/**/*.rs"]),
    crate = "live_commit_sync_config_test",
    crate_root = "test/main.rs",
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:pretty_assertions",
        ":live_commit_sync_config",
        "//common/rust/shed/cached_config:cached_config",
        "//common/rust/shed/fbinit:fbinit",
        "//common/rust/shed/fbinit:fbinit-tokio",
        "//eden/mononoke/megarepo_api:pushredirect",
        "//eden/mononoke/metaconfig:metaconfig_types",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
        "//eden/mononoke/mononoke_types:mononoke_types",
        "//eden/mononoke/server/context:context",
    ],
)
